package com.runshu.runshuwulian.ui.fragment;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.hyphenate.easeui.widget.EaseImageView;
import com.runshu.runshuwulian.MApplication;
import com.runshu.runshuwulian.R;
import com.runshu.runshuwulian.base.BaseFragment;
import com.runshu.runshuwulian.bean.LoginBean;
import com.runshu.runshuwulian.ui.activity.LoginActivity;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Demo class
 *
 * @author yu
 * @date 11/26/20
 * @decs：
 */

public class MineFrg extends BaseFragment {
    @BindView(R.id.iv)
    EaseImageView iv;
    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.iv_xx)
    ImageView ivXx;
    @BindView(R.id.red_pot)
    ImageView redPot;
    @BindView(R.id.tv_xhd_num)
    TextView tvXhdNum;
    @BindView(R.id.tv_xhsps_num)
    TextView tvXhspsNum;
    @BindView(R.id.bt_xhqk)
    TextView btXhqk;
    @BindView(R.id.tv_bhd_num)
    TextView tvBhdNum;
    @BindView(R.id.tv_bhsps_num)
    TextView tvBhspsNum;
    @BindView(R.id.bt_bhqk)
    TextView btBhqk;
    @BindView(R.id.bt_logout)
    TextView btLogout;

    @Override
    protected int setLayoutId() {
        return R.layout.frg_mine;
    }

    @Override
    protected void initView() {
        super.initView();
        LoginBean loginInfo = MApplication.instance.getLoginInfo();
        tvName.setText( loginInfo.getUsername() );
    }


    @OnClick({R.id.bt_bhqk, R.id.bt_logout})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.bt_bhqk:
                break;
            case R.id.bt_logout:
                MApplication.instance.removeUserInfo();
                startActivityByDefaultAnim( LoginActivity.class );
                getActivity().finish();
                break;
        }
    }
}